import request from '@/utils/request'

const docsPromptApi = {
    /**
     * 文件列表
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
        name?: string;
    }): Promise<any> {
        return request.get({
            url: '/apply/docs/prompt/lists',
            params
        })
    },

    /**
     * 文件详情
     */
    detail(id: number): Promise<any> {
        return request.get({
            url: '/apply/docs/prompt/detail',
            params: {
                id
            }
        })
    },

    /**
     * 文件新增
     */
    add(params: {
        icon: string;
        name: string;
        intro: string;
        is_disable: number;
        prompt_dialogue: string;
        prompt_abstract: string;
        prompt_translate: string;
        models_dialogue: string;
        models_abstract: string;
        models_translate: string;
        config_dialogue: any;
        config_abstract: any;
        config_translate: any;
    }): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/add',
            params
        })
    },

    /**
     * 文件编辑
     */
    edit(params: {
        id: number;
        icon: string;
        name: string;
        intro: string;
        is_disable: number;
        prompt_dialogue: string;
        prompt_abstract: string;
        prompt_translate: string;
        models_dialogue: string;
        models_abstract: string;
        models_translate: string;
        config_dialogue: any;
        config_abstract: any;
        config_translate: any;
    }): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/edit',
            params
        })
    },

    /**
     * 文件删除
     */
    delete(id: number): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/lists',
            params: {
                id
            }
        })
    }
}

export default docsPromptApi
